<div id="new-password" v-cloak>
  <div style="max-width: 450px" class="container-fluid pt-5 pb-5 mx-auto">
    <h1 class="text-left">Change your password?</h1>
    <div purpose="customer-portal-form">
      <div class="card card-body order-first">
        <ajax-form action="updatePasswordAndLogin" :syncing.sync="syncing" :cloud-error.sync="cloudError" :form-data="formData" :form-rules="formRules" :form-errors.sync="formErrors" @submitted="submittedForm()">
          <div class="form-group">
            <label for="password">New password</label>
            <input class="form-control" id="password" name="password" type="password"  :class="[formErrors.password ? 'is-invalid' : '']" v-model.trim="formData.password" autocomplete="new-password" focus-first>
            <div class="invalid-feedback" v-if="formErrors.password === 'required'">Please enter a password.</div>
            <div class="invalid-feedback" v-if="formErrors.password === 'minLength'">Password too short.</div>
            <p class="mt-2"> Minimum length is 8 characters</p>
          </div>
          <div class="form-group">
            <label for="confirm-password">Confirm password</label>
            <input class="form-control" id="confirm-password" name="confirm-password" type="password"  :class="[formErrors.confirmPassword ? 'is-invalid' : '']" v-model.trim="formData.confirmPassword" autocomplete="new-password">
            <div class="invalid-feedback" v-if="formErrors.password === 'minLength'">Password too short.</div>
            <div class="invalid-feedback" v-if="formErrors.confirmPassword">Your new password and confirmation do not match.</div>
          </div>
          <cloud-error v-if="cloudError"></cloud-error>
          <ajax-button purpose="submit-button" spinner="true" type="submit" :syncing="syncing" class="btn btn-info btn-lg btn-block">Submit</ajax-button>
        </ajax-form>
      </div>
    </div>
  </div>
</div>
<%- /* Expose locals as `window.SAILS_LOCALS` :: */ exposeLocalsToBrowser() %>
